package com.zkj.request;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Servlet_Req_Demo2 extends HttpServlet {

	/**
	 * 请求转发
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setAttribute("name", "smn");
		// ServletContext sc = this.getServletContext();
		// RequestDispatcher rd = sc.getRequestDispatcher("/zkjTest/rDemo8");
		// rd.forward(req, resp);
		req.getRequestDispatcher("/rDemo8").forward(req, resp);
		;
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}

}
